package com.mininglamp.drools;

import com.mininglamp.mode.Input;
import com.mininglamp.mode.Output;
import org.kie.api.runtime.StatelessKieSession;

/**
 * 规则引擎入口
 */
public class RuleEngineApp {
    public static Output execute(Input focus){
        StatelessKieSession session = KieSessionFactory.KieSession("ksession-rules");
        StatelessKieSession session1 = KieSessionFactory.KieSession("ksession-rules1");
        /*输出对象*/
        final Output output = new Output();
        /*全局对象*/
        session.setGlobal("output",output);
        /*运行规则*/
        session.execute(focus);

        /*最终结果*/
        return output;
    }
}
